<template>
    <div class="card3">
        <div v-for="(item, index) in data" :key="index" class="items" @click="toTeacherInfo(item.teacher_id)">
            <img :src="item.avatar" alt="">
            <div class="content">
                <p style="color:orange">{{item.real_name}}</p>
                <p>{{item.sex==0?"男":"女"}}&nbsp;{{item.teach_age}}年教龄</p>
            </div>
            <div class="btn" @click="toAsk(item.teacher_id)">
                预约
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        props:["data"],
        methods:{
            toTeacherInfo(id){
                this.$emit("toTeacherInfo",id)
            },
            toAsk(id){
                this.$emit("toAsk",id)
            },
            
        },
        
    }
</script>

<style lang="scss" scoped>
.card3{
    padding: 10px;
}
.items{
    width: 100%;
    height: 80px;
    background:white;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 10px;
    img{
        width: 40px;
        height: 40px;
        border-radius: 40px;
        margin:0 10px;
    }
    .content{
        width: 220px;
        p{
            line-height: 20px;
        }
    }
    .btn{
        width: 60px;
        height: 30px;
        text-align: center;
        line-height: 30px;
        color: orange;
        border-radius: 20px;
        background: rgb(240, 240, 240);
    }
}
</style>